package com.linwen.javase.desgin_pattern.BigTalkDesignPattenJAVACode._09建造者模式._1基本代码;

import java.util.ArrayList;

public class Test {

    public static void main(String[] args){

        Director director = new Director();
        Builder b1 = new ConcreteBuilder1();
        Builder b2 = new ConcreteBuilder2();

        //指挥者用ConcreteBuilder1的方法来建造产品
        director.construct(b1); //创建的是产品A和产品B
        Product p1 = b1.getResult();
        p1.show();
        
        //指挥者用ConcreteBuilder2的方法来建造产品
        director.construct(b2); //创建的是产品X和产品Y
        Product p2 = b2.getResult();
        p2.show();
    }
}











